package com.dobby.snippet;

import java.io.IOException;
import java.util.Properties;

/**
 * java 读取属性文件
 * Created by jonas on 2017/2/24.
 */
public class LoadProperties {


    protected static Properties properties;

    public static void loadProp() {
        properties = new Properties();
        try {
            properties.load(LoadProperties.class.getResourceAsStream("/cassandra.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        String clusterName = properties.getProperty("cluster.name");
        String clusterHosts = properties.getProperty("cluster.hosts");
        String keyspace = properties.getProperty("cassandra.keyspace");
        String columnFamily = properties.getProperty("cassandra.syslogColumnFamily");
    }

    public static void main(String[] args) {
        LoadProperties.loadProp();
    }


}
